<template>
  <div>
    <InnerPageTable ref="appTable" :config="tableConfig"></InnerPageTable>
  </div>
</template>
<script>
import { outerAppColumns } from "./columns.js";
import appAssignUserAPI from "@/api/appAssignUserAPI.js";
// import valueSetAPI from "@/api/valueSetAPI.js";
import locales from "./locales.js";

export default {
  name: "outer-app-list",
  mixins: [locales],
  props: {},
  data() {
    return {
      tableData: []
    };
  },
  computed: {
    tableConfig() {
      return {
        resource: this.tableData,
        columnsFn: outerAppColumns.bind(this),
        isPage: false,
        autoFirst: false,
        rowClickHandle: this.onRowClick,
        highlightRow: true,
        rowClassNameFn: this.rowClassName // 自定义行样式
      };
    }
  },
  created: function() {
    this.init();
  },
  mounted() {},
  methods: {
    // 自定义行样式
    rowClassName(row) {
      // enabled:1-有效；0-无效
      if (row.enabled == 0) {
        return "tableDisableStyle";
      }
    },
    init() {
      appAssignUserAPI.getThirdPartyApp("THIRD_PARTY_APP").then(data => {
        this.tableData = data;
      });
    },
    onRowClick(row) {
      this.$emit("click", row);
    }
  },
  watch: {},
  directives: {}
};
</script>
<style lang="less"></style>
